Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#15889: Fix handling of mantissa rounding to respect ties round to even #16997

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

TT-BrianLiu
Copy link
Contributor

@TT-BrianLiu TT-BrianLiu commented Jan 22, 2025

Ticket

Link to Github Issue

Problem description

See issue for more context and examples. When we handle rounding of mantissa when going from float to block float, we always round to nearest (ties always round up), which doesn't folow the "ties round to even" rule. This PR fixes that and adds lower c++ tests to test the different cases.

What's changed

  • Update host logic with correct rounding of mantissa
  • Add tt_metal gtest to test convert_u32_to_bfp rounding logic for bfp8
  • Remove unused functions in tt_metal/api/tt-metalium/bfloat8.hpp

Checklist

@TT-BrianLiu TT-BrianLiu force-pushed the bliu/main2 branch 3 times, most recently from ffde881 to ed50ad6 Compare January 30, 2025 15:21
- Add tt_metal gtest to test convert_u32_to_bfp rounding logic for bfp8
- Remove unused functions in tt_metal/api/tt-metalium/bfloat8.hpp
- Update impacted tests/models to reflect minor differences
  * Minor pcc adjustment in op tests
  * Skip typecast for bfp16 to bfp8 (issue 17237)
  * Update expected demo output for Falcon40B demo test
    ** This will break CI which uses cached bfp8 weights
    ** Model weights need to be re-generated and cached
@TT-BrianLiu TT-BrianLiu merged commit b6947b5 into main Jan 30, 2025
10 checks passed
@TT-BrianLiu TT-BrianLiu deleted the bliu/main2 branch January 30, 2025 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants